from django.template import Library# 创建模型注册器实例对象register = Library()@register.filterdef odd_even(num):    if num % 2 == 0:        return '偶数'    else:        return '奇数'